<?php
include('../../include/functions.inc.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Rechazo de Cheques</title>
        <link href="../../bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
        <link href="../../css/ContentStyle.css" rel="stylesheet" type="text/css" />
        <link href="../../js/protocalendar/datepicker.css" rel="stylesheet" type="text/css" />
        <link href="../../css/tableorderer.css" rel="stylesheet" type="text/css" />
        <link href="../../js/dialog/dialog.2.0.css" rel="stylesheet" type="text/css" />
        <script src="../../js/jquery.js" type="text/javascript"></script>
        <script>jQuery.noConflict();</script>
        <script src="../../bootstrap/js/bootstrap.js"></script>
        <script src="../../js/prototype.js" type="text/javascript"></script>
        <script src="../../js/jsvalidate.js" type="text/javascript"></script>
        <script src="../../js/protocalendar/prototype-date-extensions.js" type="text/javascript"></script>
        <script src="../../js/protocalendar/datepicker.js"  type="text/javascript"></script>
        <script src="../../js/TableOrderer.js" type="text/javascript"></script>
        <script src="../../js/dialog/dialog.2.0.js" type="text/javascript"></script>
        <script src="../../js/include.js" type="text/javascript"></script>
        <style type="text/css">
            input,
            textarea{
                width: 300px;
            }
            select{
                width: 314px;
            }
        </style>
        <style type="text/css">
            input,
            textarea{
                width: 300px;
            }
            select{
                width: 314px;
            }
        </style>
        <script type="text/javascript">
            showCheques=function(){
                var f=new Hash({tittle:'Listado de Cheques Activos',url:'lschekes.php',callback:selCheke,
                    width:500,height:500});
                setList(null,f.toObject());
            }

            selCheke=function(s){
                $("NUMERO").value=s.NUMERO;
                $("MONTO").value=s.MONTO;	
                //$("NMONTO").value=s.MONTO;	
                $("FACTURA").value=s.FACTURA;
                $("BANCO").value=s.BANCO;	
                $("ID").value=s.ID;
            }


            var rsv;
            config=function(){
                rsv=new RSV({
                    formID: $(document.form),
                    errorFieldClass: "errorField",
                    rules: ["required,NUMERO,Selecciones un Cheque!",
                        "required,CONCEPTO,Escriba el concepto del rechazo!"],
                    displayType : "display-html",
                    errorHTMLItemBullet : "&#8212; ",
                    onCompleteHandler:function(){
                        waitMsg("Guardando...");
                        $('operation').value='r';
                        $(document.form).request({onComplete:function(r){
                                closeWait();
                                waitMsg("El cheque ha sido rechazado!!");								 
                                $(document.form).reset();
                                closeWait();
                            }
                        });
                    }
                });
            }
            addOnLoad(config);

        </script>
    </head>

    <body>
        <div id="tabs">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a>Cheque a Rechazar</a>
                </li>
            </ul>
        </div>
        <div id="tabs-cont">
            <div id="rsvErrors"></div>
            <form id="form" name="form" method="GET" action="data.php">

                <table class=""  width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <th scope="col" width="50%"></th>
                        <th scope="col" width="50%" valign="middle" ><input name="GUARDAR" type="button" onclick="rsv.validate();" value="Guardar" class="btn btn-info" id="GUARDAR" /></th>
                    </tr>
                    <tr>
                        <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="15%">NO CHEQUE</td>
                                    <td width="85%">            <input name="NUMERO"  type="text" id="NUMERO" size="30" readonly="readonly" />
                                        <input name="buscar" onclick="showCheques()" type="button" class="btn btn-small" id="buscar"  value="..." />            </td>
                                </tr>
                                <tr>
                                    <td>MONTO</td>
                                    <td><input  name="MONTO" type="text" id="MONTO" readonly="readonly" size="30" /></td>
                                </tr>
                                <tr>
                                    <td>FACTURA</td>
                                    <td><input name="FACTURA" readonly="readonly" type="text" id="FACTURA" size="30" /></td>
                                </tr>
                                <tr>
                                    <td>BANCO</td>
                                    <td><input name="BANCO" readonly="readonly" type="text" id="BANCO" size="30" />
                                        <input name="operation" type="hidden" id="operation" value="new" />
                                        <input type="hidden" id="ID" name="ID" />          </td>
                                </tr>
                                <tr>
                                    <td><label for="CONCEPTO">CONCEPTO</label></td>
                                    <td><textarea name="CONCEPTO" id="CONCEPTO" cols="45" rows="5"></textarea></td>
                                </tr>
                            </table>      </td>
                    </tr>
                </table>
            </form>
        </div>
    </body>
</html>
